import { defineStore } from "pinia";
import {ref} from 'vue';

export const useUserInfoStore = defineStore('userInfo',()=>{
    //1.定义状态相关的内容
    const info = ref('')

    //2.定义修改token的方法
    const setInfo = (newInfo)=>{
        info.value = newInfo
    }

    //3.定义移除token的方法
    const removeInfo = ()=>{
        info.value = ''
    }
    return {
        info,setInfo,removeInfo
    }
},
{
    //开启持久化
    persist: true
}
);